<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <div id="test" class="footer" index="2"></div>
    <script>
      var div = document.querySelector('div');
      div.removeAttribute('id');
      div.removeAttribute('class');
      div.removeAttribute('index');
    </script>
  </body>
</html>